<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>this.state</title>
	<script src="../js/react.js"></script>
    <script src="../js/react-dom.js"></script>
    <script src="../js/browser.min.js"></script>
</head>
<body>
	<h1>this.state</h1>
	<div id="example"></div>
	<script type="text/babel">
		var LikeButton = React.createClass({
			getInitialState: function() {
				return {liked: false};
			},
			handleClick: function() {
				console.log(this.state.liked)
				this.setState({liked: !this.state.liked});
			},
			render: function() {
				var txt = this.state.liked ? "like" : "not like";
				return (<p onClick={this.handleClick}> you {txt} bisu. click to toggle</p>);
			}
		});
		ReactDOM.render(
			<LikeButton />,
			document.querySelector("#example")
			)
	</script>
</body>
</html>